package cc.comac.mom.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import cc.comac.mom.api.EquipPartBorrowDemandService;
import cc.comac.mom.bean.EquipPartBorrowDemand;
import cc.comac.mom.bean.EquipPartBorrowDetailBean;
import cc.comac.mom.util.ResultBean;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/EquipPartBorrowDemand")
public class EquipPartBorrowDemandController {

	@Autowired
	private EquipPartBorrowDemandService equipPartBorrowDemandService;
	@RequestMapping(value = "/selectBysomeFields",method = RequestMethod.POST)
	@ApiOperation("通过条件查询领用数据")
	public ResultBean selectBysomeFields(@RequestBody EquipPartBorrowDemand equipPartBorrowDemand) {
		ResultBean selectBysomeFields = equipPartBorrowDemandService.selectBysomeFields(equipPartBorrowDemand);
		return selectBysomeFields;
	}
	@ApiOperation("通过备件id查询备件所在仓库及库存等数据")
	@RequestMapping(value = "/selectSpareWarehouseStock",method = RequestMethod.POST)
	public ResultBean selectSpareWarehouseStock(@RequestBody EquipPartBorrowDetailBean equipPartBorrowDetailBean) {
		ResultBean selectSpareWarehouseStock = equipPartBorrowDemandService.selectSpareWarehouseStock(equipPartBorrowDetailBean);
		return selectSpareWarehouseStock;
	}
}
